package cn.fatgod.learn.thymeleaf.ast;

import cn.fatgod.learn.thymeleaf.ast.model.FieldItem;
import cn.hutool.core.io.resource.ResourceUtil;
import com.github.javaparser.ast.Node;
import com.github.javaparser.ast.body.TypeDeclaration;

import java.util.Optional;

/**
 * 类（接口）AST工具
 */
public class ClassAstUtils {

    public static String appendConstantInInterface(String source, String typeName, FieldItem field) {
        TypeDeclaration<?> rtd = AstUtils.parse(source, typeName);
        TypeDeclaration<?> td = AstUtils.searchType(rtd, typeName);

    }

    public static void main(String[] args) {
        String s = ResourceUtil.getResourceObj("Enum").readUtf8Str();
        TypeDeclaration<?> parse = AstUtils.parse(s, "BusinessType");
        Optional<Node> parentNode = parse.getParentNode();
        TypeDeclaration<?> parse1 = parse;
        System.out.println(parse);
    }
}
